import request from '@/utils/request'

// 项目用户相关的请求地址
enum API {
  GETCODE_URL = '/user/code',
  USERLOGIN_URL = '/user/login',
  GETUSERINFO_URL = 'user/GetInfo',
  USERUPDATE_URL = 'user/update',
  USERUPLOADIMG_URL = '/user/uploadImage',
  USERUPLOADS_URL = '/user/uploads',
  USERGETALLSCHOOL_URL = '/admin/GetALLSchool',
  USERIMAGE_ULR = '/user/downLoadImage',
}

// 发送邮箱验证码
export const reqGetCode = (data: any) => request.post<any, any>(API.GETCODE_URL, data)

// 用户登录
export const reqLogin = (data: any) => request.post<any, any>(API.USERLOGIN_URL, data)

// 获取用户信息
export const reqUserInfo = () => request.get<any, any>(API.GETUSERINFO_URL)

// 修改用户信息
export const reqUpdateUserInfo = (data: any) => request.post<any, any>(API.USERUPDATE_URL, data)

// 用户修改头像
export const reqUpdateUserImg = (data: any) => request.post<any, any>(API.USERUPLOADIMG_URL, data)

// 用户获取所有可以选的课程
export const reqGetAllSchool = (data: any) => request.post(API.USERGETALLSCHOOL_URL, data)

// 用户上传选课信息
export const reqUploads = (data: any) => request.post(API.USERUPLOADS_URL, data)

// 获取用户头像（流式）
export const reqDownload = () => request.get(API.USERIMAGE_ULR)
